package com.xique.door.api;

import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.api.factory.RemoteBuildingFallbackFactory;
import com.xique.door.api.request.build.RemoteAreaListRequest;
import com.xique.door.api.request.build.RemoteBuildingListRequest;
import com.xique.door.api.request.build.RemoteHouseListRequest;
import com.xique.door.api.request.build.RemoteHouseUserListRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author shd
 * @create 2022/3/8 11:04
 */
@FeignClient(contextId = "RemoteBuildingService", value = ServiceNameConstants.DOOR_BIZ_SERVICE, fallbackFactory = RemoteBuildingFallbackFactory.class)
public interface RemoteBuildingService {

    /**
     * 获取区域列表
     * @author shd
     * @date 2022/3/8 11:17
     * @param request
     * @return com.xique.common.core.domain.R<com.xique.door.api.dto.BuildingListDTO>
     */
    @PostMapping("community/area/openApi/v1/list")
    AjaxResult getAreaList(@RequestBody RemoteAreaListRequest request);

    /**
     * 获取楼栋列表
     * @author shd
     * @date 2022/3/8 11:17
     * @param request
     * @return com.xique.common.core.domain.R<com.xique.door.api.dto.BuildingListDTO>
     */
    @PostMapping("community/building/openApi/v1/list")
    AjaxResult getBuildingList(@RequestBody RemoteBuildingListRequest request);

    /**
     * 获取房屋列表
     * @author shd
     * @date 2022/3/8 11:17
     * @param request
     * @return com.xique.common.core.domain.R<com.xique.door.api.dto.BuildingListDTO>
     */
    @PostMapping("community/house/openApi/v1/list")
    AjaxResult getHouseList(@RequestBody RemoteHouseListRequest request);

    /**
     * 获取房屋住户列表
     * @author shd
     * @date 2022/3/8 11:17
     * @param request
     * @return com.xique.common.core.domain.R<com.xique.door.api.dto.BuildingListDTO>
     */
    @PostMapping("community/house/openApi/v1/userList")
    AjaxResult getHouseUserList(@RequestBody RemoteHouseUserListRequest request);
}
